package com.learn.ccs;


import java.util.concurrent.CountDownLatch;

//JUC辅助类  减法计数器
public class CountDownLatchDemo {

    public static final int NUM = 6;

    public static void main(String[] args) throws InterruptedException {
        CountDownLatch latch = new CountDownLatch(NUM);
        for (int i = 0; i < NUM; i++) {
            System.out.println(i + " go out!");
            latch.countDown();
        }
        latch.await();
        System.out.println("close door!");
    }
}
